#include "stdafx.h"
#include "ckCheckResultSet.h"
#include "ckCheckResult.h"

namespace ck
{
	namespace check
	{

		CheckResultSet::CheckResultSet()
		{
		}


		CheckResultSet::~CheckResultSet()
		{
			CheckResult* pResult = NULL;
			std::vector<CheckResult*>::iterator iter;
			for (iter = m_results.begin(); iter != m_results.end(); iter++)
			{
				pResult = (*iter);
				pResult->Release();
			}
			m_results.clear();
		}


		void CheckResultSet::Add(CheckResult* pResult)
		{
			if (pResult)
			{
				m_results.push_back(pResult);
			}
		}

		z_uint32 CheckResultSet::GetCount()
		{
			return m_results.size();
		}

		CheckResult* CheckResultSet::GetResult(z_uint32 i)
		{
			if (i >= m_results.size())
			{
				return NULL;
			}
			return m_results[i];
		}
	}
}

